/*
 This file will contain all the functions that have
 to do with the response struct
*/

#include "cli_net.h"

/*
 This function mallocs a new server response
 struct with the given parameters
 */
RESP *newResp(int code, char *message)
{
    RESP *r = chk_malloc(sizeof(RESP));
    r->code = code;
    r->message = message;
    
    return r;
    
}

//frees the given response and its message and sets it to null
void freeResp(RESP **r)
{
    free((*r)->message);
    free(*r);
    *r = NULL;
}